﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Automobile.service.Common;
using Automobile.service.Model;
using Automobile.service.BLL;
using System.Data;
using System.Data.SqlClient;
namespace Automobile.service.UI
{
    public partial class PurchaseOutShow : System.Web.UI.Page
    {
        PurchaseOutBLL bll = new PurchaseOutBLL();
        public void LoadData()
        {
            int count;
            this.Repeater1.DataSource = bll.Purchase_Show(this.AspNetPager1.CurrentPageIndex,3,out count);//设置数据源
            this.Repeater1.DataBind();//绑定数据源
            this.AspNetPager1.PageSize = 3;
            this.AspNetPager1.RecordCount = count;//设置总行数;
            this.Label1.Text = count.ToString();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                LoadData();
            }
        }


        protected void AspNetPager1_PageChanged1(object sender, EventArgs e)
        {
            LoadData();
        }

        protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string eName = e.CommandName;//获取当前要执行的命令名称
            string stuID = e.CommandArgument.ToString();//获取当前绑定的主键值
            switch (eName)
            {
                case "USH":
                    Response.Redirect("PurchaseOut.aspx?id=" + stuID);
                    break;
            }

        }

     

    }
}